package org.eenie.core.ext

import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.google.gson.JsonObject
import com.google.gson.JsonParser

fun String.toPrettyJson(): String {
    val parser = JsonParser()
    val json: JsonObject = parser.parse(this).asJsonObject
    val gson: Gson = GsonBuilder().setPrettyPrinting().create()
    return gson.toJson(json)
}